package com.turing.data.scripts.yhlc.transfer

import com.turing.data.vo.out.review.DependParamsVO
import com.turing.data.vo.out.review.TaskElementVO


class Date_30249_46_transfer {

    static List< TaskElementVO.DrawResultVO > doConvert(List< TaskElementVO.DrawResultVO > resultVOs, DependParamsVO dependParams){

        for( drawResultVO in resultVOs ) {

            String modelValue = drawResultVO.text
            modelValue = modelValue.replaceAll("曰","日")
            def index_year = modelValue.indexOf("年")
            def index_month= modelValue.indexOf("月")
            def index_day = modelValue.indexOf("日")
            def year = modelValue.substring(0,index_year)
            def month = modelValue.substring(index_year+1,index_month)
            def day = modelValue.substring(index_month+1,index_day)
            println(year)
            println(month)
            println(day)
            if(month.length() == 1){
                month = "0" + month
            }
            if(day.length() == 1){
                day = "0" + day
            }
            def result = year + month + day
            drawResultVO.businessValue = result
            drawResultVO.type = 1

        }

        return resultVOs
    }

}
